package fr.emse.tatiana.replayable.analysis.graph;

import org.eclipse.gef.ContextMenuProvider;
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.gef.ui.actions.GEFActionConstants;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.ui.actions.ActionFactory;

public class GraphContextMenuProvider extends ContextMenuProvider {

	
	private ActionRegistry actionRegistry;	
	
	public GraphContextMenuProvider(EditPartViewer viewer, ActionRegistry registry) {
		super(viewer);
		actionRegistry = registry;
	}
	
	@Override
	public void buildContextMenu(IMenuManager menu) {
		IAction a;
		a = actionRegistry.getAction(ActionFactory.RENAME.getId());
		menu.add(a);
		a = actionRegistry.getAction(ActionFactory.DELETE.getId());
		menu.add(a);
		a = actionRegistry.getAction(GEFActionConstants.ZOOM_IN);
		menu.add(a);
		a = actionRegistry.getAction(GEFActionConstants.ZOOM_OUT);
		menu.add(a);
	}

}
